<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Date的常用方法</title>
    
</head>
<body>
    <script type="text/javascript">
        var now = new Date();
        // 常用方法
        console.log(now);
        
        // 获取日期
        console.log(now.getDate());

        // 获取月份 从零开始 需要加一
        console.log(now.getMonth() + 1);

        // 获取年份
        console.log(now.getFullYear());

        // 获取星期 0表示周天
        console.log(now.getDay());

        console.log(now.getHours());
        console.log(now.getMinutes());
        console.log(now.getSeconds());
    </script>
</body>
</html>